package com.sugou.model.datas;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.sugou.model.commons.ImagesLibrary;
import com.sugou.model.core.base.LongIdEntity;

@Entity(name="Commodity")
@Table(name="GW_COMMODITY")
public class Commodity extends LongIdEntity {
	private static final long serialVersionUID = -541165249558514738L;
	
	@Column(length=100,nullable=false)
	private String name;
	
	@Column(length=1000,nullable=true)
	private String alias;
	
	@Column
	private Double price;
	
	@ManyToOne(cascade={CascadeType.ALL},fetch=FetchType.LAZY)
	@JoinColumn(name="IMAGES_ID")
	private ImagesLibrary images;

	@ManyToOne(cascade={CascadeType.ALL},fetch=FetchType.LAZY)
	@JoinColumn(name="MERCHANTS_ID")
	private Merchants merchants;
	
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getAlias() {
		return alias;
	}

	public void setAlias(String alias) {
		this.alias = alias;
	}

	public Double getPrice() {
		return price;
	}

	public void setPrice(Double price) {
		this.price = price;
	}

	public ImagesLibrary getImages() {
		return images;
	}

	public void setImages(ImagesLibrary images) {
		this.images = images;
	}

	public Merchants getMerchants() {
		return merchants;
	}

	public void setMerchants(Merchants merchants) {
		this.merchants = merchants;
	}
	

}
